package com.ruoyi.buss.customer.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.buss.customer.mapper.DataCustomerRecordMapper;
import com.ruoyi.buss.customer.domain.DataCustomerRecord;
import com.ruoyi.buss.customer.service.IDataCustomerRecordService;

/**
 * 客户变更记录Service业务层处理
 * 
 * @author sxy
 * @date 2021-07-16
 */
@Service
public class DataCustomerRecordServiceImpl implements IDataCustomerRecordService 
{
    @Autowired
    private DataCustomerRecordMapper dataCustomerRecordMapper;

    /**
     * 查询客户变更记录
     * 
     * @param id 客户变更记录ID
     * @return 客户变更记录
     */
    @Override
    public DataCustomerRecord selectDataCustomerRecordById(String id)
    {
        return dataCustomerRecordMapper.selectDataCustomerRecordById(id);
    }

    /**
     * 查询客户变更记录列表
     * 
     * @param dataCustomerRecord 客户变更记录
     * @return 客户变更记录
     */
    @Override
    public List<DataCustomerRecord> selectDataCustomerRecordList(DataCustomerRecord dataCustomerRecord)
    {
        return dataCustomerRecordMapper.selectDataCustomerRecordList(dataCustomerRecord);
    }

    /**
     * 新增客户变更记录
     * 
     * @param dataCustomerRecord 客户变更记录
     * @return 结果
     */
    @Override
    public int insertDataCustomerRecord(DataCustomerRecord dataCustomerRecord)
    {
        dataCustomerRecord.setCreateTime(DateUtils.getNowDate());
        return dataCustomerRecordMapper.insertDataCustomerRecord(dataCustomerRecord);
    }

    /**
     * 修改客户变更记录
     * 
     * @param dataCustomerRecord 客户变更记录
     * @return 结果
     */
    @Override
    public int updateDataCustomerRecord(DataCustomerRecord dataCustomerRecord)
    {
        dataCustomerRecord.setUpdateTime(DateUtils.getNowDate());
        return dataCustomerRecordMapper.updateDataCustomerRecord(dataCustomerRecord);
    }

    /**
     * 批量删除客户变更记录
     * 
     * @param ids 需要删除的客户变更记录ID
     * @return 结果
     */
    @Override
    public int deleteDataCustomerRecordByIds(String[] ids)
    {
        return dataCustomerRecordMapper.deleteDataCustomerRecordByIds(ids);
    }

    /**
     * 删除客户变更记录信息
     * 
     * @param id 客户变更记录ID
     * @return 结果
     */
    @Override
    public int deleteDataCustomerRecordById(String id)
    {
        return dataCustomerRecordMapper.deleteDataCustomerRecordById(id);
    }
}
